package com.gxa.customer.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxa.common.commons.R;
import com.gxa.common.pojo.FieldList;
import com.gxa.customer.mapper.FieldMapper;
import com.gxa.customer.service.FieldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FieldServiceImpl extends ServiceImpl<FieldMapper, FieldList> implements FieldService {
    @Autowired
    private FieldMapper fieldMapper;

    //查询所有领域
    @Override
    public R selectAllField() {
        R r = new R();

        List<FieldList> fieldLists = fieldMapper.selectList(null);

        if(fieldLists == null){
            r.setCode(500);
            r.setMsg("找不到参数！！！");
            return r;
        }else {
            r.setCode(200);
            r.setMsg("查询成功！");
            r.setData(fieldLists);
            return r;
        }
    }
}
